import Vue from 'vue'
import Vuex from 'vuex'

import * as actions from './actions'
import * as getters from './getters'
import mutations from './mutations'

Vue.use(Vuex)

// 定义各组件需要进行通信的数据
const state = {
    VimNum: '',
    VimOldData: '',
    VimBaseData: '',
    VimChangedCcw: false,
    VimChangedCth: false,
    VimChangedEscf: false,
    // 评估结果
    CCWEvaluteRsult: {
        error: true
    },
    CTHEvaluteRsult: {
        error: true
    },
    ESCFEvaluteRsult: {
        error: true
    },
    // 品牌数据
    ccwPPList: '',
    cthPPList: '',
    escfPPList: '',
    // 车虫网
    ccwCondition: {
        type: '',
        curSimleTime: '',
        curSelect: '',
        curChildSelect: '',
        curModels: ''
    },
    // 车300网
    cthCondition: {
        type: '',
        curSimleTime: '',
        curSelect: '',
        curChildSelect: '',
        curModels: ''
    },
    // 二手车之家
    escfCondition: {
        type: '',
        curSimleTime: '',
        curSelect: '',
        curChildSelect: '',
        curModels: ''
    },
    //公共属性
    commonCondition: {
        ccwProvinceSelect: '',
        ccwCitySelect: '',
        cthProvinceSelect: '',
        cthCitySelect: '',
        escfProvinceSelect: '',
        escfCitySelect: '',
        distance: '',
        selectedMonth: '',
        selectedYear: ''
    }
}

export default new Vuex.Store({
    state,
    mutations,
    getters,
    actions
})


/*
  {
    "type": "2",
    "selectedYear": 2017,
    "selectedMonth": 2,
    "selectedProvince": {
        "id": "1",
        "name": "北京",
        "parentId": 0,
        "i": "",
        "level": 1
    },
    "selectedCity": {
        "id": "1",
        "name": "北京",
        "parentId": "1",
        "i": "B",
        "level": 2
    },
    "curSimleTime": "2017",
    "curSelect": {
        "b_id": "1",
        "pp_name": "奥迪",
        "zimu": "A"
    },
    "curChildSelect": {
        "series_id": "5",
        "series_name": "奥迪A3",
        "series_group_name": "一汽奥迪",
        "id": "5",
        "name": "奥迪A3"
    },
    "curModels": {
        "model_id": "1128962",
        "model_name": "2017款 奥迪A3 Sportback 35 TFSI 进取型",
        "model_price": "18.8",
        "model_year": "2017",
        "min_reg_year": 2017,
        "max_reg_year": 2017,
        "liter": "1.4",
        "liter_type": "1",
        "gear_type": "2",
        "discharge_standard": "国5"
    },
    "distance": "2"
}


*/